package com.abocode.aichat.server.context;

import com.abocode.aichat.server.channel.ProtocolChannelRegistry;
import com.abocode.aichat.server.delivery.inbound.InboundServerDeliver;
import com.abocode.aichat.server.delivery.outbound.OutboundServerDeliver;
import com.abocode.aichat.server.endpoint.EndpointRegistry;
import com.abocode.aichat.server.pipeline.MessageGatewayPipeline;
import com.abocode.aichat.server.worker.Worker;
/**
 * Created by franky-7.
 */
public class ServerRuntimeContext {

    private String domain;

    private String name;

    private ProtocolChannelRegistry protocolChannelRegistry;

    private MessageGatewayPipeline messageGatewayPipeline;

    private InboundServerDeliver inboundServerDeliver;

    private OutboundServerDeliver outboundServerDeliver;

    private Worker worker;



    public InboundServerDeliver getInboundServerDeliver() {
        return inboundServerDeliver;
    }

    public void setInboundServerDeliver(InboundServerDeliver inboundServerDeliver) {
        this.inboundServerDeliver = inboundServerDeliver;
        inboundServerDeliver.setServerRuntimeContext(this);
    }

    public OutboundServerDeliver getOutboundServerDeliver() {
        return outboundServerDeliver;
    }

    public void setOutboundServerDeliver(OutboundServerDeliver outboundServerDeliver) {
        this.outboundServerDeliver = outboundServerDeliver;
        outboundServerDeliver.setServerRuntimeContext(this);
    }

    public Worker getWorker() {
        return worker;
    }

    public void setWorker(Worker worker) {
        this.worker = worker;
        worker.setServerRuntimeContext(this);
    }

    public boolean validateDomain(String domain){
        return getDomain().equals(domain);
    }

    public String getDomain() {
        return domain;
    }

    public void setDomain(String domain) {
        this.domain = domain;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public ProtocolChannelRegistry getProtocolChannelRegistry() {
        return protocolChannelRegistry;
    }

    public void setProtocolChannelRegistry(ProtocolChannelRegistry protocolChannelRegistry) {
        this.protocolChannelRegistry = protocolChannelRegistry;
    }

    public MessageGatewayPipeline getMessageGatewayPipeline() {
        return messageGatewayPipeline;
    }

    public void setMessageGatewayPipeline(MessageGatewayPipeline messageGatewayPipeline) {
        this.messageGatewayPipeline = messageGatewayPipeline;
    }

    public EndpointRegistry getGatewayChannelRegistry() {
        return null;
    }
}
